package a04_字符串;

import java.util.Scanner;

/**
 * <p>
 * a05_右旋字符串复习5
 * </p>
 *
 * @author flyduck
 * @since 2025/2/25
 */
public class a05_右旋字符串复习5 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int num = scanner.nextInt();
        String str = scanner.next();

        //abcdef
        //fedcba
        //efabcd

        char[] chars = str.toCharArray();
        reverse(chars, 0, chars.length-1);
        reverse(chars, 0, num-1);
        reverse(chars, num, chars.length-1);
        System.out.println(new String(chars));
    }

    private static void reverse(char[] chars,int leftIdx,int rightIdx){
        while (leftIdx < rightIdx){
            char temp = chars[leftIdx];
            chars[leftIdx] = chars[rightIdx];
            chars[rightIdx] = temp;
            leftIdx++;
            rightIdx--;
        }
    }
}
